package com.denlaku.longan.controller;

import com.denlaku.longan.http.Return;
import com.denlaku.longan.vo.CustomApi;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * @author tianx
 */
@RequestMapping("/api/custom-api")
public interface CustomApiDataController {
    /**
     * 获取自定义API数据
     *
     * @param customApi 自定义API
     * @return 响应对象
     */
    @PostMapping("/fetch")
    Return<List<Map<String, Object>>> fetch(@RequestBody CustomApi customApi);

    /**
     * 获取自定义API数据
     *
     * @param customApis 自定义API列表
     * @return 响应对象
     */
    @PostMapping("/fetches")
    Return<Map<Long, List<Map<String, Object>>>> fetches(@RequestBody List<CustomApi> customApis);

}
